package com.haois.mp.wechat.common;

import com.xxl.job.core.log.XxlJobLogger;

import java.util.Map;

/**
 * description
 *
 * @author RuiHaoZ on hgits.cn
 * @date 2018/11/2 14:00
 */
public class JobLogCollect {
    public static String log(Map<String, Object> params) {
        String msg = "";
        try {
            String accordSize = String.valueOf(params.get("accordSize"));
            String pushSize = String.valueOf(params.get("pushSize"));
            msg = "本次任务中符合条件数据共" + accordSize + "条，合计推送" + pushSize + "次";
            XxlJobLogger.log((String) params.get("content"));
        } catch (Exception e) {
            XxlJobLogger.log(e.getMessage());
            msg = "任务可能已经完成，但是日志记录失败";
        }
        return msg;
    }
}
